/*
 * Copyright 2010-2012 Susanta Tewari. <freecode4susant@users.sourceforge.net>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package coalescent.recursion;

import coalescent.EventType;
import coalescent.model.PopGenModel;
import coalescent.statistic.AC;

/**
 * Contains information during the post-order recursion implementation of a sample onfiguration used
 * to notify the interested listeners.
 *
 * @author Susanta Tewari
 * @version 1.3.0 Dec 3, 2010
 */
public class RecursionEvent {

    /** Field description */
    private final Recursion src;

    /** Field description */
    private final RecursionEventType recursionEventType;

    /** Field description */
    private final AC sampleConfig;

    /** Field description */
    private final AC ancestralConfig;

    /** Field description */
    private final Object allele;

    /** Field description */
    private final EventType eventType;
    private int responseCode;

    /**
     *
     * @param src
     * @param recursionEventType the type of the recursion event, indicating a particular point of
     * traversal.
     * @param sampleConfig the sample configuration; always non-null
     * @param ancestralConfig
     * @param allele
     * @param eventType
     */
    public RecursionEvent(final Recursion src, final RecursionEventType recursionEventType,
                          final AC sampleConfig, final AC ancestralConfig, final Object allele,
                          final EventType eventType) {

        this.src                = src;
        this.recursionEventType = recursionEventType;
        this.sampleConfig       = sampleConfig;
        this.ancestralConfig    = ancestralConfig;
        this.allele             = allele;
        this.eventType          = eventType;
    }

    public int getResponseCode() {
        return responseCode;
    }

    public void setResponseCode(final int responseCode) {
        this.responseCode = responseCode;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public RecursionEventType getRecursionEventType() {
        return recursionEventType;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public AC getSampleConfig() {
        return sampleConfig;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public AC getAncestralConfig() {
        return ancestralConfig;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public Object getAllele() {
        return allele;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public EventType getEventType() {
        return eventType;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public AC getStatistic() {
        return src.getStatistic();
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public PopGenModel getModel() {
        return src.getModel();
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public Recursion getSrc() {
        return src;
    }
}
